package com.ss.android.lockscreen.a;

import android.content.Context;

import com.ss.android.lockscreen.http.data.ScreenCell;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.HashMap;

import inline.NetworkDemo;

public final class a {
    private static String a;

    static {
        a = "LockScreenAction";
    }

    public static void a(Context arg11, ScreenCell arg12) {
        long v2 = arg12.f;
        long v4 = arg12.g;
        long v6 = System.currentTimeMillis();
        JSONArray v8 = new JSONArray();
        JSONObject v1 = new JSONObject();
        try {
            v1.put("channel_id", Long.valueOf("76722923628"));
        }
        catch(JSONException v0) {
            v0.printStackTrace();
        }

        String v9 = v1.toString();
        if(arg11 != null && (NetworkDemo.a(arg11))) {
            new Thread(new b(arg11, v2, v4, v6, v8, v9)).start();
        }
    }

    static boolean a(Context arg2, String arg3, long arg4, long arg6, long arg8, JSONArray arg10, String arg11) {
        return b(arg2, arg3, arg4, arg6, arg8, arg10, arg11);
    }

    private static boolean b(Context arg6, String arg7, long arg8, long arg10, long arg12, JSONArray arg14, String arg15) {
        try {
            StringBuilder v0_1 = new StringBuilder("http://open.snssdk.com/data/stream/dislike/tt_sl/v1?");
            android.support.design.a.a(v0_1, arg6);
            String v0_2 = v0_1.toString();
            String v1 = "application/json; charset=utf-8";
            JSONObject v2 = new JSONObject();
            v2.put("action", arg7);
            v2.put("type", 1);
            v2.put("id", arg8);
            v2.put("item_id", arg10);
            v2.put("aggr_type", 1);
            v2.put("timestamp", arg12 / 1000);
            v2.put("filter_words", arg14);
            v2.put("extra", arg15);
            byte[] v2_1 = v2.toString().getBytes("UTF-8");
            new HashMap().put("Content-Type", v1);
            if(com.ss.android.lockscreen.bb.a().d == null) {
                boolean v0_3 = false;
                return v0_3;
            }

            v0_2 = com.ss.android.lockscreen.e.e$c.a(v0_2, v2_1, v1);
            if(v0_2 == null || v0_2.length() == 0) {
                return false;
            }

            if(!"success".equals(new JSONObject(v0_2).optString("message"))) {
                return false;
            }
        }
        catch(Throwable v0) {
            com.ss.android.lockscreen.utils.a.b(a, "throwable in doSendActionsV3 : " + v0.toString());
            return false;
        }
        return true;

    }
}

